package com.dangdang.sharding.mapstruct.mapper;

import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

import com.dangdang.sharding.mapstruct.common.CommonMS;
import com.dangdang.sharding.mapstruct.dto.CarDto;
import com.dangdang.sharding.mapstruct.mapper.transform.CarTransform;
import com.dangdang.sharding.mapstruct.po.Car;

@Mapper(uses = CarTransform.class)
public interface CarMS extends CommonMS<Car, CarDto> {

	CarMS INSTANCE = Mappers.getMapper(CarMS.class);

	@Mappings({ @Mapping(source = "seatCount", target = "numberOfSeats") })
	CarDto toDTO(Car p);

	@Mappings({ @Mapping(source = "numberOfSeats", target = "seatCount") })
	Car toPo(CarDto d);
}